package com.example.java_chatroom_redis_rabbitmq.service;

import com.example.java_chatroom_redis_rabbitmq.mapper.NewFriendMapper;
import com.example.java_chatroom_redis_rabbitmq.model.Message;
import com.example.java_chatroom_redis_rabbitmq.model.NewFriend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NewFriendService {
    @Autowired
    private NewFriendMapper newFriendMapper;

    public Integer addNewFriend(Message message) {
        return newFriendMapper.addNewFriend(message);
    }

    public Integer deleteNewFriend(Integer fromId,Integer toId) {
        return newFriendMapper.deleteNewFriend(fromId,toId);
    }

    public List<NewFriend> getNewFriendList(Integer toId) {
        return newFriendMapper.getNewFriendList(toId);
    }
}
